{% extends ext_tpl %}
{% url wizard.mycontragents status as the_url %}
{% block style %}
	<link href="/css/report.css" rel="stylesheet" type="text/css" />
	{{ block.super }}
{% endblock %}

{% block header %}
<h1>Список {% ifequal status 'debtor' %}должников{% else %}кредиторов{% endifequal %}</h1>
{% if byte %}
<h4>Фильтр: наименование начинается с буквы &lsquo;{{byte}}&rsquo; </h4>
{% endif %}
{% endblock %}

{% block text %}
{% load pagination_tags %}
<form action="." method="post">
<div class="report">
{% if firms %}
<h5>Организации</h5>
	<div class="ind">
		<div class="clirep">
				<table class="details">
					<tr class="head">
						<th class="check">&nbsp;</th>
						<th><a href = "{{ the_url }}?sortf=name">Наименование</a></th>
						<th class="inn"><a href = "{{ the_url }}?sortf=inn">ИНН</a></th>
						<th class="city"><a href = "{{ the_url }}?sortf=city">Город</a></th>
					</tr>
				{% autopaginate firms 20 %}
					{% for firm in firms %}
					<tr>
						<td class="check"><input type="checkbox" class="action-select" value="{{firm.id}}" name="_selected_action" /></td>
						<td><a href = "/contragent/firm/{{firm.id}}/">{{firm.name}}</a></td>
						<td class="inn">{{firm.inn}}</td>
						<td class="city">{{firm.city}}</td>
					</tr>
					{% endfor %}
				</table>
				{% paginate %}
				 <button type="submit" class="button" title="Выполнить выбранное действие" name="index" value="1"><span>Добавить</span></button>
				 <button type="submit" class="button" title="Выполнить выбранное действие" name="index" value="0"><span>Удалить</span></button>
		</div>
	</div>
{% endif %}
{% if individuals %}
<h5>Физические лица</h5>
	<div class="ind">
		<div class="clirep">
				<table class="details">
					<tr class="head">
						<th class="check">&nbsp;</th>
						<th><a href = "{{ the_url }}?sorti=fio">Ф.И.О.</a></th>
						<th class="inn"><a href = "{{ the_url }}?sorti=inn">ИНН</a></th>
						<th class="city"><a href = "{{ the_url }}?sorti=city">Город</a></th>
						<th><a href = "{{ the_url }}?sorti=address">Адрес</a></th>
					</tr>
				{% autopaginate firms 20 %}
					{% for ind in individuals %}
					<tr>
						<td class="check"><input type="checkbox" class="action-select" value="{{ind.id}}" name="_selected_action" /></td>
						<td><a href = "/contragent/individuals/{{ind.id}}/">{{ind.fio}}</a></td>
						<td class="inn">{{ind.inn}}</td>
						<td class="city">{{ind.city}}</td>
						<td>{{ind.address}}</td>
					</tr>
					{% endfor %}
				</table>
				{% paginate %}
				<button type="submit" class="button" title="Выполнить выбранное действие" name="index" value="2"><span>Добавить</span></button>
 				<button type="submit" class="button" title="Выполнить выбранное действие" name="index" value="0"><span>Удалить</span></button>
		</div>
	</div>
{% endif %}
</div>
</form>
{% endblock %}

{% block left_center %}
{% include "alf.tpl" %}
{{block.super}}
{% endblock %}

